<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <link href="../../public/css/bootstrap.min.css"
          th:href="@{/webjars/bootstrap/3.3.7-1/css/bootstrap.min.css}"
          rel="stylesheet" media="screen"/>
    <script src="http://cdn.jsdelivr.net/webjars/jquery/3.2.1/jquery.min.js"
            th:src="@{/webjars/jquery/3.2.1/jquery.min.js}"></script>
    <title>
        ProSpring5 Singer Boot Application
    </title>
</head>
<body>
<div class="container">
    <div th:fragment="header">
        <nav class="navbar navbar-inverse">
            <div class="container-fluid">
                <div class="navbar-header">
                    <a class="navbar-brand" href="#" th:href="@{/}">ProSpring 5</a>
                </div>
                <ul class="nav navbar-nav">
                    <li><a href="#" th:href="@{/singers}">Singers</a></li>
                    <li><a href="#" th:href="@{/singers/new}">Add Singer</a></li>
                </ul>

                <ul class="nav navbar-nav navbar-right" >
                    <li th:if="${#authorization.expression('!isAuthenticated()')}">
                        <a href="/login" th:href="@{/login}">
                            <span class="glyphicon glyphicon-log-in"></span>&nbsp;Log in
                        </a>
                    </li>
                    <li th:if="${#authorization.expression('isAuthenticated()')}">
                        <a href="/logout" th:href="@{#}" onclick="$('#form').submit();">
                            <span class="glyphicon glyphicon-log-out"></span>&nbsp;Logout
                        </a>
                        <form style="visibility: hidden" id="form" method="post" action="#" th:action="@{/logout}"></form>
                    </li>
                </ul>

            </div>
        </nav>
    </div>
</div>
</body>
</html>